package com.xiaoshuidi.cloud.module.iot.service;

import com.xiaoshuidi.cloud.module.iot.dal.model.device.TbDeviceDosageCallbackModel;
import com.xiaoshuidi.cloud.module.iot.dal.pojo.TbDeviceDo;

/**
 * @author Sky
 * create 2019/06/18
 * email sky.li@ixiaoshuidi.com
 **/
public interface LocalCallbackService {
    /**
     * 修改tb_device记录
     * deviceThirdNo 与 brandNo是必须的
     *
     * @param tbDeviceDo
     * @return
     */
    boolean updateTbDeviceRecord(TbDeviceDo tbDeviceDo) throws Exception;

    /**
     * 电量水量记录回调处理
     *
     * @param tbDeviceDosageCallbackModel
     * @return
     */
    void disposeDeviceDosage(TbDeviceDosageCallbackModel tbDeviceDosageCallbackModel);

    /**
     * 开门记录回调处理
     *
     * @param tbDeviceDosageCallbackModel
     * @throws Exception
     */
    void disposeOpenRecordCallback(TbDeviceDosageCallbackModel tbDeviceDosageCallbackModel) throws Exception;

    /**
     * 据sn查询tb_device记录
     *
     * @param deviceName
     * @param brandNo
     * @return
     */
    TbDeviceDo getTbDeviceByDeviceNameAndBrandNo(String deviceName, String brandNo);

    TbDeviceDo getTbDeviceByConditon(String deviceThirdNo, String brandNo);

    Boolean tianchengUpdateTbDeviceRecord(TbDeviceDo tbDeviceDo);
}
